package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.common.ResponseResult;
import com.heima.model.common.dtos.wemedia.WmLoginDto;
import com.heima.wemedia.service.WmUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 自媒体端登录相关接口
 */
@Api(value = "/login", tags = {"自媒体端登录相关接口"})
@RestController
@RequestMapping("/login")
public class LoginController {

    @Autowired
    private WmUserService wmUserService;

    /**
     * 自媒体端登录功能
     * @param dto
     * @return
     */
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", dataType = "WmLoginDto", name = "dto", value = "", required = true)
    })
    @ApiOperation(value = "自媒体端登录功能", notes = "自媒体端登录功能", httpMethod = "POST")
    @PostMapping("/in")
    public ResponseResult login(@RequestBody WmLoginDto dto){
        return wmUserService.login(dto);
    }
}
